Hi,
I have an app that the user logs their travel for reimbursement and management has a new requirement the user has to have one map per day of travel. Before I had it set up to generate one map with every waypoint for all of the travel recorded. With this change, I am trying to set it up where the user will use a date picker to select which day they need to generate the map, map open in a new tab for them to download and upload.
In this section of code I am getting “Unexpected Characters. The Formula contains 'BracketOpen' where ParenClose is expected” and if I take away the brackets then I get this error: “Unexpected Operator. We expect an operator such as +, *, or & at this point in the formula.
ClearCollect(
GoogleItemsOrigin,
First(GoogleItemsWaypoints)['cr0d7_mildestination']);
ClearCollect(
GoogleItemsDest,
Last(GoogleItemsWaypoints)['cr0d7_mildestination']
);
Here is the complete code:
ClearCollect(
GoogleItemsWaypoints,
ShowColumns(
Filter(
'Travel Reimbursements',
!IsBlank('Mil Date of Travel') &&
'Mil Date of Travel' = DatePickerTravelDate.SelectedDate
),
"cr0d7_travelid",
"cr0d7_mildestination"
)
);
ClearCollect(
GoogleItemsWaypoints,
ForAll(
Sequence(CountRows(GoogleItemsWaypoints)),
Patch(
Last(FirstN(GoogleItemsWaypoints, Value)),
{RowNumber: Value}
)
)
);
ClearCollect(GoogleItemsOrigin,
First(ShowColumns(Search(
Filter(
'Travel Reimbursements',
!IsBlank('Mil Date of Travel')
),
TravelSelection,
"cr0d7_travelid"
),"cr0d7_milorigin"))
);
ClearCollect(
GoogleItemsOrigin,
First(GoogleItemsWaypoints)['cr0d7_mildestination']);
ClearCollect(
GoogleItemsDest,
Last(GoogleItemsWaypoints)['cr0d7_mildestination']
);
Set(varMaxWaypoint, Max(GoogleItemsWaypoints, RowNumber));
ClearCollect(
GoogleItemsWaypoints,
Filter(GoogleItemsWaypoints, RowNumber <> varMaxWaypoint)
);
Launch("https://www.google.com/maps/dir/?api=1&origin=" & GoogleItemsOrigin[0]['cr0d7_mildestination'] & "&destination=" & GoogleItemsDest[0]['cr0d7_mildestination'] & "&travelmode=driving&waypoints=" & Concatenate(GoogleItemsWaypoints, "cr0d7_mildestination", "|"))

Report
All responses (
Answers (