cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NiugeS
Helper I
Helper I

Use formula in Add Row with cell reference

Hi all,

Hoping someone can help me with this.  I have a flow that when triggered, updates an excel spreadsheet in sharepoint.  Issue is the date (column B) is not in a date / time format. 

I'm using the add row function and had  =DATEVALUE(LEFT(B2,10))+TIMEVALUE(MID(B2,12,8)).

NiugeS_0-1611706247493.png


Problem is the row is added at the end of the table and C5 should reflect =DATEVALUE(LEFT(B510))+TIMEVALUE(MID(B5,12,8)).  Any suggestions on how I can update the addrow to know what is the correct cell reference?

Any help appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @NiugeS :

Something like this?

1.JPG

If so,the Expression should be:

formatDateTime(triggerOutputs()?['body/Created'],'dd/MM/yyyy hh:mm:ss')

Best Regards,

Bof

 

View solution in original post

7 REPLIES 7
v-bofeng-msft
Community Support
Community Support

Hi @NiugeS :

"2021-01-26T23:36:45.000Z" is the date in the standard ISO 8601 format.You can use this formula to convert it to the format of ‘dd/MM/yyyy hh:mm:ss’:

formatDateTime(B5,'dd/MM/yyyy hh:mm:ss')

I've made a test for your reference:

48.gif

Reference Expression:

formatDateTime(triggerBody()['text'],'dd/MM/yyyy hh:mm:ss')

 

Best Regards,

Bof

NiugeS
Helper I
Helper I

@v-bofeng-msft  Thank you for the reply.  The problem is if I add another row, the next formula will require formatdatetime(b6,'dd/MM/yyyy hh:mm:ss')


The issue is the table grows by one each time and I'm not sure on how to reference the correct cell.

v-bofeng-msft
Community Support
Community Support

Hi @NiugeS :

Could you tell me how the 'add a row' action is set?

In addition, what is the value used to update columnB?

Best Regards,

Bof

When a ticket type is created in a database, it triggers the addrow.  The value is CreatedDate. 

I hope i've answered your questions.  Apologies - a bit new to all of this still.

v-bofeng-msft
Community Support
Community Support

Hi @NiugeS :

Something like this?

1.JPG

If so,the Expression should be:

formatDateTime(triggerOutputs()?['body/Created'],'dd/MM/yyyy hh:mm:ss')

Best Regards,

Bof

 

NiugeS
Helper I
Helper I

@v-bofeng-msft Thanks for the help.  I'm still trying to get this to work.  There must be somethign wrong with the expression i'm doing as i'm getting One or more fields provided is of type 'Null', a different type is expected.

Without this expression, the flow works fine so something i'm doing wrong.

 

NiugeS_0-1611783431788.png

 

NiugeS
Helper I
Helper I

@v-bofeng-msft Thank you for your help.  I was able to get it work!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (5,583)