Actions
open-media-picker
4 min
this action lets you immediately open the media picker, enabling you to capture images and videos or select media files, then output the selected files configuration options core structure title provide a short title to display on the action button you can use text, an expression or a datasource to set the title mediatype by default the value is set to image the following options are available for selection 1\) any is for files of any extension such as pdf, jpeg, png, mpeg, txt, or docx set to any allows you to take a picture, record a video, select an image or video from the library, or select a document using mediatype any is recommended when uploading multiple media files as it caters for any file type 2\) csv select csv files 3\) doc select doc or docx files 4\) image used to take a picture or select from the image library 5\) imageandvideo take a picture, record a video or select an image or video from the library 6\) pdf select pdf files 7\) plaintext select plain text files 8\) ppt select ppt or pptx files 9\) video record a video or upload one from the library 10\) xls select xls or xlsx files configure filters to restrict media types based on your app’s requirements, for example, only allow document files doc, pdf or plain text mediatype doc pdf other options icon specify the icon https //docs jigx com/jigx icons to display on the action button the icon only applies to swipeable , secondary , and header docid\ published r57wu4jbktamxhkj5scnn actions icon setups are not supported on primary actions imagecropping you can set any of the following with imagecropping isenabled allows you to crop an image height maximum allowed is 5000px width maximum allowed is 5000px isfreestylecropenabled when set to true it supports custom cropping to change the size or aspect ratio of an image imagequality image quality after compression (from 0 to 100, where 100 is the best quality) on ios, values larger than 80 don't produce a noticeable quality increase in most images, while a value of 80 will reduce the file size by about half or less compared to a value of 100 default 100 (android)/ 80 (ios) ishidden when set to true the action button is hidden ismultiple set to true allows for multiple files to be added or shown set to false allows for a single file maximumfilesize maximumfilesize =6 1024 1024 by default set the value to none if no size evaluations must be performed file size format is in bytes applies to images and videos style add styling to the action button more than one can be set to true, evaluation is based on priority \ isdanger change the button style to error \ isdisabled disables the button preventing it from being tapped \ isprimary change style of the button to primary default is primary outputs key notes =@ctx actions instanceid outputs newitems string\[] used for newly added items that were successfully uploaded =@ctx actions instanceid outputs invaliditems string\[] used for options that are invalid or failed to upload successfully considerations files captured using the media field component can be saved to dynamic files docid\ published z9udvbge jallff2a98a6 by assigning them to the file property of a dynamic data entity, enabling seamless upload and storage in amazon s3 examples and code snippets open media picker to capture an image in this example, the button opens the media picker the configuration is set to take a picture or choose from library the image is saved to the local database action open media picker action open media picker jigx title job details type jig default header type component jig header options height small children type component image options source uri > https //images unsplash com/photo 1640682841767 cdfce3aea6e0 ?w=800\&auto=format\&fit=crop\&q=60\&ixlib=rb 4 0 3 \&ixid=m3wxmja3fdb8mhxzzwfyy2h8mtb8fhbsdw1izxj8zw58mhx8mhx8fda%3d children \ type component form instanceid form details options isdiscardchangesalertenabled false children \ type component text field instanceid job number options label job number \ type component text field instanceid job notes options ismultiline true label add notes \ type component checkbox instanceid checklist options icon check color positive label completed checklist? \ type component date picker instanceid job date options label job date actions \ children \ type action action list options title take a photo issequential true actions \# add the media picker action to open the media modal \ type action open media picker \# use an id that is used to reference \# the action's output when saved as data instanceid job photo options \# specify the type of media required mediatype image \# use an action to save the images to a data provider \ type action execute entities options provider data provider local method save entity local images \# use the action's output to reference the image file data =@ctx actions job photo outputs