cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kol
Level: Powered On

Type Conversion Issue (string to int)

Hi,

 

I built 2 custom connectors: one which returns a JSON object like {"id":"123","name":"name123"} and the other one which needs to take an int. I try to use them one after the other, and use the id obtained in the first connector to put in the second connector.

 

Of course when I try to put ID directly in the field it doesn't work because ID is a string and we need an int, but when I try to put int(ID) it gives me this problem:

InvalidTemplate. 
Unable to process template language expressions in action 'Modify_a_LeadDesk_agent' inputs at line '1' and column '1767': 
'The template language expression 'int(body('Find_an_agent')?['id'])' cannot be evaluated because property 'id' cannot be selected. 
Property selection is not supported on values of type 'String'. 
Please see https://aka.ms/logicexpressions for usage details.'.

Does this mean I can't do a type conversion like int("string") in a field that only accepts ints?
If that's the case, how can I do my type conversion?
1 ACCEPTED SOLUTION

Accepted Solutions
Kol
Level: Powered On

Re: Type Conversion Issue (string to int)

EDIT: This was solved, it came from our API's end, which returned a "Content-Type →text/html; charset=utf-8" instead of Json.

3 REPLIES 3
Community Support Team
Community Support Team

Re: Type Conversion Issue (string to int)

Hi @Kol,

 

Could you please share a screenshot of your flow?

The error message told that the template language expression 'int(body('Find_an_agent')?['id'])' cannot be evaluated because property 'id' cannot be selected, I afraid that you have used the wrong expression, please share more details so we would try to peovide a proper workaround for you.

 

Best regards,

Community Support Team _ Alice Zhang

Kol
Level: Powered On

Re: Type Conversion Issue (string to int)

Hi @v-yuazh-msft,

 

Thank you for your answer! Here are some screenshots:

flow3.png

This is what I'm currently using: trying to convert the ID from Find an agent (string) into an int.

 

As you can see in the screenshot below, I get ID from Find an agent (the id is only numbers):

flow2.png

Kol
Level: Powered On

Re: Type Conversion Issue (string to int)

EDIT: This was solved, it came from our API's end, which returned a "Content-Type →text/html; charset=utf-8" instead of Json.

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 56 members 4,306 guests
Please welcome our newest community members: