Hi @igonzalez1
Thank you for posting.
According to your description, you would like to check the latest modified file from onedrive. If any misunderstanding. Please kindly let me know.
We can configure as below:
1.Add a button trigger.
2.Add OneDrive connector List files in folder.
3.Initialize variable, set Name as LastM, Type as Array.
4.Add Apply to each, inside the Apply to each add the action Append to array variable. Set Name as LastM, and set Value with the following code:
ticks(items('Apply_to_each')?['LastModified'])
5.Under the Apply to each, add a Compose action with the following code to get the Max value:
max(variables('LastM'))
6.Add Apply to each 2, select output Value from the action List files in folder.
7.Within the Apply to each, add a Condition with the following configuration to get the Max one:
@equals(ticks(items('Apply_to_each_2')?['LastModified']), outputs('Compose'))
8.Under if yes branch, add a Compose to return the file name.
Flow overview:

Flow in detail:


Once tested, I’m able to get the latest file.

Hope the content above may help you.
Best regards,
Anna