@philifova ,
That is a completely different question and not straight-forward (it would be quite easy using the last attachment as I posted earlier).
This was a brain-bender and my best effort is below (and I cannot test it beyond it being valid code) - it should set your Variable to the content of the last attachment with an Excel extension
With(
{
wExt:
ForAll(
AttachControlName.Attachments,
{
Ext:
Last(
Split(
Name,
"."
)
).Result
}
)
},
With(
{
wPos:
ForAll(
Sequence(CountRows(wExt)),
Patch(
Last(
FirstN(
wExt,
Value
)
),
{RowNo: Value}
)
)
},
Set(
varAttachment,
Index(
AttachControlName.Attachments,
LookUp(
Sort(
wPos,
RowNo,
Descending
),
Ext = "xlsx"
).RowNo
).Value
)
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps