I want to create a atlas composer map using PyQGIS3. How can I take dynamic path by field from atlas layer?
In PyQGIS3 I need some like this :
pict = QgsLayoutItemPicture(layout) pict.setPicturePath(myAtlas['pict']) pict.setFrameEnabled(True)
myAtlas is my
pict is my field with paths.
For the expression, you should use the following
if( file_exists(attribute(@atlas_feature, 'pict')), attribute(@atlas_feature, 'pict'), '/tmp/fallback.png' )