0

Can a function created in QGIS be used in the QField program? And if it is possible, is there a way to do that?

1 Answer 1

2

No.QField does not support user defined functions. However, it does support expressions. Are you sure an expression will not suffice?

If not, QField does support triggers, which may provide a workaround.

10
  • I use the function editor to get the expression, through which I can get the name of the device that uses the offline project. It was tested on qgis and it works normally, but when I transfer the file to qfield, the expression does not work. Is there help or a solution for that? The basis of the process is to obtain the name of the device that draws in the Qfield ( add the device name as field on layers ) Feb 21 at 21:14
  • What is your expression?
    – Oisin
    Feb 21 at 21:23
  • You could add a variable on each device, e.g. 'device_name' and then access that variable using @device_name.
    – Oisin
    Feb 21 at 21:23
  • Is it possible to lock the variable after adding it? So that no one can change it Feb 21 at 21:51
  • 1
    This won't work in QField. QField does not support user defined functions. So you need a workaround. See this Issue on GitHub. github.com/opengisch/QField/issues/4635
    – Oisin
    Feb 22 at 12:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.