Hi
I am utilizing a flow to validate an uploaded Excel file. Upon clicking the upload button, I initiate the loader with a start(true) command, and upon the timer ending, I conclude the loader with an end(false) command.
Onselect property of upload button (Given)
UpdateContext({varShowLoader: true});
UpdateContext({varLoaderTitle: "Loading your Directory Group Template"});
UpdateContext({varLoaderSubTitle: "Please wait...We are uploading excel." & Char(10) & "The upload may take while, please do not close/refresh the browser."});
RemoveIf(
SPList_ExcelUploadHistory,
UploadedBy = varLoggedEnterpriseId
);
If(
IsBlank(Last(IconAddBrowseAttachment_MDGS.Attachments).Value),
Notify(
"Please attach a file to proceed",
NotificationType.Error
),
Set(
varAttachedfile,
JSON(
ImgUploadAttachment_MDGS.Image,
JSONFormat.IncludeBinaryData
)
);
Set(
varBase64,
Mid(
varAttachedfile,
Find(
",",
varAttachedfile
) + 1,
Len(varAttachedfile) - Find(
",",
varAttachedfile
) - 1
)
);
);
SAA_UploadBulkDirectoryGroups.Run(
{
text: varBase64,
text_1: varLoggedEnterpriseId
}
);
({varUploadTimer: true});
OnTimmerEnd Property (Given)
If(
!IsBlank(
LookUp(
SPList_ExcelUploadHistory,
UploadedBy = varLoggedEnterpriseId
)
) And !IsBlank(varLoggedEnterpriseId) And varUploadTimer,
UpdateContext(
{
varFlowResponse: LookUp(
SortByColumns(
SPList_ExcelUploadHistory,
"ID",
SortOrder.Descending
),
UploadedBy = varLoggedEnterpriseId
).ErrorMessages
}
);
UpdateContext(
{
varUploadedTime: LookUp(
SortByColumns(
SPList_ExcelUploadHistory,
"ID",
SortOrder.Descending
),
UploadedBy = varLoggedEnterpriseId
).UploadedOn
}
);
UpdateContext({varUploadTimer: false});
If(
"Successfully" in varFlowResponse,
Notify(
"Directory Group Template has been uploaded successfully",
NotificationType.Success
),
If(
"columns have been modified" in varFlowResponse Or "empty in uploaded file" in varFlowResponse Or "Invalid details" in varFlowResponse Or "valid and already exists" in varFlowResponse Or "CIOPowerPlatform account has not been added as Owner." in varFlowResponse,
Notify(
varFlowResponse,
NotificationType.Error
),
Notify(
"Something went wrong",
NotificationType.Error
)
)
);
UpdateContext({varShowTemplateError: true});
UpdateContext({varopenBulkUploadPopup: false});
UpdateContext({varShowLoader: false});
Refresh(SPList_DirectoryGroup);
);
The loader should be displayed until the Excel validation is completed(validation response getting from flow). Once validation is successfully done, the loader should be turned off.
Please inform me of any mistakes I may have made.
Please find the below attachment