Last updated
Was this helpful?
Was this helpful?
title: Create Monthly Invoice
description: 2 Submit your monthly invoices
type: jig.default
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://builder.jigx.com/assets/images/header.jpg
children:
- type: component.form
instanceId: Invoices
options:
children:
# reference the fileName required property as the instanceId
- type: component.text-field
instanceId: fileName
options:
label: Month
# reference the file required property as the instanceId and use the media
# field to add the physical file, use any mediaType to allow files of
# different formats to be selected.
- type: component.media-field
instanceId: file
options:
label: Add your Invoice
mediaType: any
actions:
- children:
- type: action.action-list
options:
title: Submit
isSequential: true
actions:
- type: action.submit-form
options:
formId: Invoices
provider: DATA_PROVIDER_ONEDRIVE
entity: myfiles
method: create
data:
file: =@ctx.components.file.state.value
fileName: =@ctx.components.fileName.state.value
tokenType: jigx.graph.oauth
onSuccess:
title: Successfully created
- type: action.go-backtitle: Create Invoice
description: Create monthly invoices
type: jig.default
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://builder.jigx.com/assets/images/header.jpg
onFocus:
type: action.sync-entities
options:
#use the OneDrive provider to sync the file metadata to the local provider
provider: DATA_PROVIDER_ONEDRIVE
entities:
- entity: myfiles
data:
tokenType: jigx.graph.oauth
datasources:
file-data-root:
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: myfiles
query: SELECT id, '$.name' FROM [myfiles] WHERE '$.name' = @fileName ORDER BY '$.name' DESC
queryParameters:
fileName: =@ctx.components.New-file-Name.state.value
children:
- type: component.form
instanceId: Invoice
options:
children:
# reference the fileName required property as the instanceId
- type: component.text-field
instanceId: New-file-Name
options:
label: Month
# reference the file required property as the instanceId and use the media
# field to add the physical file, use any mediaType to allow files of
# different formats to be selected
- type: component.media-field
instanceId: file
options:
label: Add your Invoice
mediaType: any
actions:
- children:
- type: action.confirm
options:
title: Submit
# check if the filename exist
isConfirmedAutomatically: =$exists(@ctx.datasources.file-data-root.name) ? false:true
onConfirmed:
type: action.submit-form
options:
formId: Invoice
provider: DATA_PROVIDER_ONEDRIVE
entity: myfiles
method: create
data:
file: =@ctx.components.file.state.value
fileName: =@ctx.components.New-file-Name.state.value
tokenType: jigx.graph.oauth
onSuccess:
title: Successfully created
# show message if filename exists
modal:
title: File name already exists. Continuing will result in an error.
cancel: Cancel
confirm: Continue