Skip to main content
Community site session details

Community site session details

Session Id : KkydqzrtlKPswhKd3RaGNo
Power Automate - Using Connectors
Answered

How can my flow handle both integer and string inputs?

Like (0) ShareShare
ReportReport
Posted on 26 Apr 2021 15:24:09 by 15

Hi all,

 

I have a flow that processes the submissions from MS Forms, and looks up customer detail from an excel spreadsheet. I need a customer reference number as the key value to start the process. The form has a field for the customer to input their reference number, however to avoid typo errors I extract the reference number from their login details, rather than their input in the form.

 

This works great until a staff member completes the form on behalf of a customer. The flow won't be able to find any customer details from the excel spreadsheet using the staff name.  This causes an error in the flow  (excel - 'get a row'), so I use the 'configure run after - fail' option to initialise a back up process to extract the key value from the input field on the form, and then run (excel - 'get a row 2').

 

This approach is laborious and messy. It means I have to create the entire flow twice, once for the first input method and a second time for the back up method.

 

Logically I should be able to initialise a new variable and input the correct key value. So I would only need to run the subsequent process once. I would just need an 'If - Then' process to determine which key value should be used.  However all my attempts at this have failed because the Customer references are 7 digit numbers, and staff references are letters.

 

So my question is this:  How can the flow determine if the key value is a customer number (integer) or a staff name (string)?

 

I've tried changing the variable to an integer (This would work for customer numbers and fail for staff names.) However when this fails it doesn't go to the next step, but crashes the flow entirely. 

 

I've tried adding 1 to the customer number (to determine if it is a number,) it works if the value is a number but fails if it is a string. However as above this also crashes the entire flow, and won't proceed to the next step.

 

Surely there must be a way to handle both string & integer inputs without crashing the entire flow?

 

  • Verified answer
    Jedikevin Profile Picture
    15 on 14 May 2021 at 11:59:55
    Re: How can my flow handle both integer and string inputs?

    Hi,  Thanks for your reply. That solution worked!

     

    I found that the "Scope" function worked. It allowed me to conduct an 'is the variable an integer' test inside scope. And if that failed it didn't crash the whole flow, but would allow me correct it using the normal 'run after failed' option.

     

    Jedikevin_0-1620993428205.png

     

  • alrezac Profile Picture
    on 27 Apr 2021 at 18:44:31
    Re: How can my flow handle both integer and string inputs?

    Hi,

     

    You could try building something like which was built in this article below; just have the condition have two paths, one checks the ID and the other checks the staff ID.

     

    https://mydevexperience.wordpress.com/2019/09/06/microsoft-flow-how-to-determine-a-string-is-numeric/

     

    Regards,

     

    Alex

     

    -------

     

    Community Support Team _ Alex Rezac
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Loading complete