Get all items From a list through a rest api

Hi there, I’m trying to make the input i type through the input field matches the data variable through rest api, Here is the workflow that i’ve created when button is tapped

I’m using this function in the flow function to make sure that the input exists in the database IS_EQUAL(data.Students1[0].fields["Authentication Code "].stringValue, pageVars.Verification.AuthenticationCode) the problem is i only get the first item in the list while i want to make sure that it exists in the whole list, i know that [0] stands for the first item but i don’t know how to show the whole list

SELECT(data.Students1, CONTAINS(item.fields["Authentication Code "].stringValue, pageVars.Verification.AuthenticationCode))

I’ve tried this formula as well but it won’t work i got this message List type is not assignable to true/false

Any help here would be appreciated
Thanks in Advance

any reply would be much appreciated

Hey @mourad_gamal, it says “List type is not assignable to true/false” because the output of your formula is a list type and you are trying to use it within an IF condition node.

actually i tried to use it without the if condition and i found the same result, if you can clarify the right method to me it would be appreciated

Hi @mourad_gamal,

SELECT(data.Students1, CONTAINS(item.fields["Authentication Code "].stringValue, pageVars.Verification.AuthenticationCode))

gets you the list of students whose AuthenticationCode includes the authentication code in pageVars.

For the “If condition” node you’ll want to surround that statement still with


so you get the information if the list is empty or not (true/false)

Hi @Mari

Thank you for your response, i’ve already tried this formula and it won’t work please have a look

Hi, you need to use IS_EMPTY(your formula here) to get the true/false value as I mentioned earlier

@Mari Thank you so much,
It works fine i used that formula to make sure that the ( Authentication Code ) already exists in the database collection ( data.students1 ) but there is one more thing, after i create that record the authentication code i just typed will be saved in different database collection ( data.reviewsandassignment ) so i want to make sure to prevent duplication of this code and if this code already exists in ( data.reviewsandassignment ) the users will not be able to add it again
Conclusion: IF ( data.reviewsandassignment.authentication code ) 1 → users get this message → Authentication code already exists