Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collection Datatable - how to check if no records were selected (in Single selection mode) #94

Open
solo-1234 opened this issue May 28, 2021 · 0 comments

Comments

@solo-1234
Copy link
Contributor

solo-1234 commented May 28, 2021

I am working on a collection datatable with radio selected so the user can choose one Contact. FirstSelectedRecord is outputted to a single record var called matchedContact.

I then use the id of the selected record in an assignment later on. If the user did not select any records, the assignment fails because The flow failed to access the value for matchedContact.Id because it hasn't been set or assigned.

Attempted fix # 1: use a fault path to tell it to skip the assignment
Did not work because Assignments can't have fault paths

Attempted fix # 2: use a formula with BLANKVALUE or ISBLANK to check if a record was selected
Did not work because you can't use a record var in ISBLANK, and when I tried BLANKVALUE({!matchedContact.Id},'') I got the same error as above

Attempted fix # 3: use a decision to check if a record was selected, using matchedContact IS NULL TRUE
Did not work, it seems that even if no record was chosen, the var does not contain NULL

Attempted fix # 4: use an assignment to assign the count of matchedContact to a number var, and then let a decision check if the count is 1
Did not work because you can't use Add Count on a single record var

Attempted fix # 5: in addition to outputting firstSelectedRow from the datatable, also output selectedRows, and check the count of THAT in a decision.
THIS ONE WORKED
Screenshot:
https://i.imgur.com/iv6NuU4.png

Then I can run the assignment only if there was a contact selected in the datatable.

Hoping this can be simplified in the future!

Let me know if any other info would help. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant