Forum Discussion
Do Until - Get File Properties ... Invalid Template ...
- Mar 27, 2018
I think i've solved it and discovered that this is what coalesce is for. Here is my working Do Until condition without needing to assign default values to the columns in the library:
@and(not(empty(body('Get_file_properties')?['Approver'])),not(equals(coalesce(body('Get_file_properties')?['InvoiceAmountExclGST'], '0'), '0')),not(equals(coalesce(body('Get_file_properties')?['InvoiceDate'], '19000101'), '19000101')),not(equals(coalesce(body('Get_file_properties')?['InvoiceFrom'], 'Nobody'), 'Nobody')),not(equals(coalesce(body('Get_file_properties')?['InvoiceNumber'], '0'), '0')))If i understand coalesce correctly, the fallback value could be any string value. I just chose values that kind of made sense for the type of each column.
The Do Until > Get file properties loop now keeps looping until all the required fields are populated. Without generating the InvalidTemplate error.
I'll mark this as solved and hope someone finds this useful.
Ian.
I think i've solved it and discovered that this is what coalesce is for. Here is my working Do Until condition without needing to assign default values to the columns in the library:
@and(not(empty(body('Get_file_properties')?['Approver'])),not(equals(coalesce(body('Get_file_properties')?['InvoiceAmountExclGST'], '0'), '0')),not(equals(coalesce(body('Get_file_properties')?['InvoiceDate'], '19000101'), '19000101')),not(equals(coalesce(body('Get_file_properties')?['InvoiceFrom'], 'Nobody'), 'Nobody')),not(equals(coalesce(body('Get_file_properties')?['InvoiceNumber'], '0'), '0')))
If i understand coalesce correctly, the fallback value could be any string value. I just chose values that kind of made sense for the type of each column.
The Do Until > Get file properties loop now keeps looping until all the required fields are populated. Without generating the InvalidTemplate error.
I'll mark this as solved and hope someone finds this useful.
Ian.