Hi @Kengie Ho ,
Thankyou for using Microsoft Q&A platform and posting your query.
As per my understanding about your query , contains function in ADF is not working as expected and as is mentioned in the Microsoft documentation.
I tried to repro the same scenario as you did. I created a variable with the datatype as 'boolean' and when I use set variable and supply array in both 'collection' and 'value' ,it returns False for the expression:
@contains(createArray('teammembership','fctg_user_spokenlanguage','processstage','fctg_fctg_destination_fctg_consultantprofile','fctg_fctg_consultantprofiles_fctg_productcat', 'fctg_fctg_consultantprofiles_fctg_spokenlang','activityparty','arb_incident_fctg_quote'), createArray('teammembership'))
whereas when I supply 'collection' as array and 'value' parameter as string , it returns True for the expression:
@contains(createArray('teammembership','fctg_user_spokenlanguage','processstage','fctg_fctg_destination_fctg_consultantprofile','fctg_fctg_consultantprofiles_fctg_productcat', 'fctg_fctg_consultantprofiles_fctg_spokenlang','activityparty','arb_incident_fctg_quote'), 'teammembership')
However, in the first case the reason it gave false is because in example you are looking for an "array" inside the "array of strings". so in simple True is expected in the following case: [['teammembership'],'fctg_user_spokenlanguage','processstage'..] where it does not contain 'teammembership' but ['teammembership'].
So this is the correct code you need to use:
@contains(createArray(createArray('teammembership'),'fctg_user_spokenlanguage','processstage','fctg_fctg_destination_fctg_consultantprofile','fctg_fctg_consultantprofiles_fctg_productcat', 'fctg_fctg_consultantprofiles_fctg_spokenlang','activityparty','arb_incident_fctg_quote'), createArray('teammembership'))
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you.
Original posters help the community find answers faster by identifying the correct answer. Here is how - Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators