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

Update a row for 2 key columns not just 1

Hi All, 

I'm wanting to set up an automatic flow that runs off a form, updating a row if the submission time's date (or just today's date if that's easier) matches a date already in the table and the user submitting matches an email already in the table.  How do I set it up to have those 2 key columns rather than just 1?

 

Thansk in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SteTaylor 

Because your date format has time, so please change the expression as below and try again:

AddSeconds('1899-12-30',int(formatNumber(mul(float(items('Apply_to_each')?['Time1']),86400),'0')),'yyyy-MM-dd')

vLilyWmsft_0-1623995666449.png

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-LilyW-msft
Microsoft
Microsoft

Hi @SteTaylor 

Thank you for posting.

According to your description, you want to filter a row that satisfies 2 key columns.

You can use Condition action and add multiple conditions.

I created a simple Flow, you can refer to:

This is my Form

vLilyWmsft_0-1623895879785.jpeg

This is my Excel

vLilyWmsft_1-1623895879789.png

Flow in details:

vLilyWmsft_2-1623895879793.png

The first condition to determine whether the submission date is equal to the date in excel

Expression1formatDateTime(outputs('Get_response_details')?['body/submitDate'],'yyyy-MM-dd')

Expression2formatDateTime(addDays('1899-12-30',int(items('Apply_to_each')?['date'])),'yyyy-MM-dd')

The second condition determine whether the response email is equal to the email in excel

vLilyWmsft_3-1623895879798.png

If these two conditions are true, then update the row.

vLilyWmsft_4-1623895879800.png

When Test2 who email is Test2@Wicren.onmicrosoft.com submit a From. The row will be updated.

vLilyWmsft_5-1623895879801.jpeg

vLilyWmsft_6-1623895879804.png

Hope the content above may help you.

Best Regards

Lily

SteTaylor
Regular Visitor

Thanks for the speedy response @v-LilyW-msft , however I get this error when I try to run it:

Unable to process template language expressions for action 'Condition_3' at line '1' and column '38591': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

 

Here's what the flow looks like - all thats missing is the when response submitted, get response details part at the top. 
flow.png

 


The form has 2 options In or Out. In just populates a new row. Out needs to find a row where the In (called Time1) matches the submission date as well as the email matching on the key column so it can then update that row, giving me the in and out times side by side for further analysis. 

v-LilyW-msft
Microsoft
Microsoft

Hi @SteTaylor 

What is your date format in excel? Could you share the screenshot of your excel with me?

This is my date format.

vLilyWmsft_0-1623928813997.png

The date need match ISO 8601 format in Flow.

For more info about ISO 8601 you can refer to:

https://en.wikipedia.org/wiki/ISO_8601

Best Regards

SteTaylor
Regular Visitor

It's set to Date and its how the flow has already populated it in there from its first run

date.png

 @v-LilyW-msft 

Hi @SteTaylor 

Because your date format has time, so please change the expression as below and try again:

AddSeconds('1899-12-30',int(formatNumber(mul(float(items('Apply_to_each')?['Time1']),86400),'0')),'yyyy-MM-dd')

vLilyWmsft_0-1623995666449.png

Best Regards

If my solution helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (2,138)