Hi all,
I'm try to import a lot of records from a Excel table to Dataverse. Some field I need to import to a currency column. Because my Excel have in one of the currency columns ' . ' as delimiter. Because dataverse is not accept that in my environment I add this expression to my flow:
replace(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'.',',')
Good to know, not all the records in my Excel table has values with decimals, so there is not a delimitter. Also some rows don't have a value (column is empty).
But my flow is not accepting this. It shows me the following error:
The template language function 'replace' expects its first parameter 'string' to be a string. The provided value is of type 'Null'
Does any one know how to fix this?
Thanks in advance.
Solved! Go to Solution.
Just replace the empty string in the coalesce with a valid default value, like '0'
replace(coalesce(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'0'),'.',',')
Replace
'Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount']
in your function with
coalesce('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'')
That will replace any null values in the Excel sheet with a blank string.
Hi @Pstork1 ,
Thank you for your quick reply.
I just try that, but when I save my flow, it gives an error:
This is the complete (new) expression:
replace(items(coalesce('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],''),'.',',')
I think it's failed because the column where I try to add it is a currency column where a string is not possible, or is it something else?
Sorry, Cut and Paste error on my part.
replace(coalesce(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],''),'.',',')
Coalesce() in Power Automate goes through the arguments from left to right and returns the first non-null argument. So if the value in the row isn't null it will use that. If the value is then it will replace it with a blank string.
Hi @Pstork1 ,
Thanks, that don't give me the error by saving the flow.
But now I got this issue when running the flow:
The 'inputs.parameters' of workflow operation 'Add_a_new_row' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/vi_assoldbudgetamount' is required to be of type 'Number/currency'. The runtime value '""' to be converted doesn't have the expected format 'Number/double'.
Just replace the empty string in the coalesce with a valid default value, like '0'
replace(coalesce(items('Apply_to_each_|_Create_Project_Activities')?['As Sold Budget Amount'],'0'),'.',',')
Hi @Pstork1 ,
I was a little bit to quick. It seems to be that now every record has the value of €0.- but in my Excel table, not every record is empty.
Do you know how that should be fixed?
Can you look at one of the runs and see what value is actually coming out of the replace function? Also, currency columns in Dataverse are actually lookup columns. So you may need to add the actual value to a different column. Currency column explained here: Column data types in Microsoft Dataverse (contains video) - Power Apps | Microsoft Docs
User | Count |
---|---|
87 | |
43 | |
21 | |
18 | |
16 |
User | Count |
---|---|
132 | |
47 | |
42 | |
36 | |
28 |