Download a file
Download a file in jig

title: Department Expense list
description: List of Expenses
type: jig.list
inputs:
expenseId:
type: string
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://cdn.pixabay.com/photo/2023/08/22/11/57/finance-8206242_1280.jpg
# The datasource allows you to use the thumbnail image URI from the server,
# for faster loading and lower bandwidth.
# The full image for high-resolution, detailed viewing or editing.
# The image is stored in the cache (localPath) to cater for offline use,
# and repeated requests for the same image.
datasources:
expenses-ds:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_DYNAMIC
entities:
- default/expenses
query: |
SELECT
id,
'$.expenseitem',
json_extract(file, '$.localPath') as localPath,
json_extract(file, '$.fileName') as filename,
json_extract(file, '$.status') as status,
json_extract(file, '$.thumbnail.base64') as thumbnail
FROM [default/expenses]
ORDER BY '$.expenseitem'
data: [email protected]
item:
type: component.list-item
options:
title: [email protected]
subtitle: [email protected]
tags:
- text: [email protected]
color: color14
leftElement:
element: avatar
text: ""
uri: |
[email protected] != null ? 'data:image/png;base64,' & @ctx.current.item.thumbnail :
@ctx.current.item.localPath != null ? @ctx.current.item.localPath
rightElement:
element: button
title: View receipt
onPress:
type: action.action-list
options:
isSequential: true
actions:
# Configure the download method to download the file,
# to a local cache, use the current item's id.
- type: action.execute-entity
options:
provider: DATA_PROVIDER_DYNAMIC
entity: default/expenses
method: download
data:
id: [email protected]
# Configure a go-to action to view the file and file metadata.
- type: action.go-to
options:
linkTo: expense-receipt-details
inputs:
expenseId: [email protected]
actions:
- children:
- type: action.go-to
options:
title: Create Expense
linkTo: files-create-expenseDownloading multiple files
Download a file in Jigx Management
Last updated
Was this helpful?