cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bhls
Frequent Visitor

iterate array and check every character

Hello, first of all thank you for your help and your time.

I am building a flow to get to know the application.

I have been able to split a string (HOLA123) , and create a variable/array with the different elements of the initial string.

i can acces each element

But what  I need now is to access each element from the variable/array to be able to check if there is the numbre 0

But I can't get past this state.

When I get to step three and try to see if there is he existence of a particular element (0) I am not able to succeed

 

if in step 3 I do an apply to each , and then apply a condition (clasicc if) the app only check the first element of the array (H)

i have not idea how to make it so the control if actually aplies to all the characters that are passed from the array to the compose

 

 

I have no idea how to get out of that point

 

 

Thank you all.

 

 

 

 

STEP TWO

Bhls_0-1652419391043.png

 

Step 3

 

Bhls_1-1652419442755.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Bhls
Frequent Visitor

Hola again Heartholme 

 

although your answer did not exactly solved my problem, it did actually show me the way 🙂

 

this is the code

 

i´ve got the variable

 

Bhls_0-1652528485144.png

 

 

i use an Apply  to each to the variable

 

 

Bhls_1-1652528522297.png

 

 

i also add a condition , whoever, the object that the condition will check is current item

on the example I've checked if there is H and O 

 

current item here is the key since it is the object/character that will be check against the condition set

 

i did test it and the result is that it did iterate through and checked every character. showing true when one of those characters was either H or O and false other ways

 

 

 

 

 

 

 

 

Bhls_5-1652528968439.png

 

 

Bhls_4-1652528943148.png

 

 

Bhls_3-1652528906732.png

 

 

 

 

 

Once again, thx for your time helping me out

 

 

 

View solution in original post

5 REPLIES 5
Heartholme
Continued Contributor
Continued Contributor

Hi @Bhls ,

 

Use the below expression, which will take both the first chacter of your array or each element of your apply to each - for this case replace variables('Test2') with items(apply_to_each) .

 

variables('test2')[0]

 

Add a if condition if you want to do anything further. If you want to check for a number you have to put "" on both sides of the number like this "0". For normal characters put only the character: H for example.

 

Heartholme_0-1652430831752.png

Heartholme_1-1652431121757.png

 

Let me know how it goes 😄

 

{ If my post answered your question, please Accept it as a solution ✔ }
{ This will in turn help others find solutions to similar questions }

Best Regards
Heartholme

 

 

 

Bhls
Frequent Visitor

Hola, 

 

Thx for you time and effort to help me

 

 

I reply your exemple:

Bhls_0-1652509610576.png

 

 

however when i do run a test:

 

Bhls_1-1652509732547.png

 

 

i do not understand why it saus false, since there is a H at the array.

 

Thx a again for ypur time 

 

 

Heartholme
Continued Contributor
Continued Contributor

Hi again @Bhls,

 

You need to put the H in like this "H", with a "" on each side.

 

Please try that!

 

Happy to help you out! If you are satisfied with the result, please Accept my post as a solution. This will in turn help other find solutions to similar questions.

Best Regards
Heartholme

Bhls
Frequent Visitor

Hola again Heartholme 

 

although your answer did not exactly solved my problem, it did actually show me the way 🙂

 

this is the code

 

i´ve got the variable

 

Bhls_0-1652528485144.png

 

 

i use an Apply  to each to the variable

 

 

Bhls_1-1652528522297.png

 

 

i also add a condition , whoever, the object that the condition will check is current item

on the example I've checked if there is H and O 

 

current item here is the key since it is the object/character that will be check against the condition set

 

i did test it and the result is that it did iterate through and checked every character. showing true when one of those characters was either H or O and false other ways

 

 

 

 

 

 

 

 

Bhls_5-1652528968439.png

 

 

Bhls_4-1652528943148.png

 

 

Bhls_3-1652528906732.png

 

 

 

 

 

Once again, thx for your time helping me out

 

 

 

Heartholme
Continued Contributor
Continued Contributor

Hi @Bhls ,

 

Glad to hear that it works!

 

It wasn't 100% clear to me if you wanted to check the first item of your array for the character or every character in the array, which is why I said: "replace variables('Test2') with items(apply_to_each)(which is current item)", if you want to check every character from the array 😊

 

Anyways, happy to help you out! If you are satisfied with the result, please Accept my post as a solution. This will in turn help other find solutions to similar questions.

Best Regards
Heartholme

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,481)