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

CSV data import to CDS as Decimal Number

I am creating a flow where I parse CSV data.  I have setup my CDS table with text fields, Date fields and Decimal fields.  In testing I am able to load text and date fields without issue.  For the number fields I'm using the float expression to convert the number from text to a number format. In CDS I have tried both Decimal and Floating as the format but they will not load using the float expression.  If I test load the field to a text formatted column and remove the expression they load fine.  Any thoughts on resolving the issue are appreciated.  If necessary I will re-format my fields to text but would prefer to bring them in if the correct format.

 

float(items('Apply_to_each')?['txtLoadHrsBucket1'])
 
 

Unable to process template language expressions in action 'Create_a_new_record' inputs at line '1' and column '21744': 'The template language function 'float' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 
 
 

 

Shippen70_0-1609434647950.png

Shippen70_1-1609434722026.png

 
1 ACCEPTED SOLUTION

Accepted Solutions
Solution Sage
Solution Sage

Hi @Shippen70 ,

 

Could it be possible that your input string is empty or null , if so then you have to use condition to bypass null or empty string and set it to 0 if found .

 

Thanks

View solution in original post

2 REPLIES 2
Solution Sage
Solution Sage

Hi @Shippen70 ,

 

Could it be possible that your input string is empty or null , if so then you have to use condition to bypass null or empty string and set it to 0 if found .

 

Thanks

View solution in original post

You are correct, the issues was the blank records.  I modified my expression to add an if condition.  If the record is Empty write '0'.  Once I did that I was able to eliminate the errors.  Thanks.

 

if(empty(items('Apply_to_each')?['txtCapacityBucket1']),'0',formatnumber(float(items('Apply_to_each')?['txtCapacityBucket1']),'f'))

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (20,615)