If I have a geoalgorithm in my model and I want the value from one the parameters, then how can I get it? For example I want the layer name in the parameter
layer in below figure so I get the value
Don't think you could do this directly through the modeler but you could create a custom script which, when run can simulate a model, allows you to fetch the name of the layer and use it for processing.
The following script uses the Field Calculator tool which creates a new field with the layer name and populates the values with the layer name (the python command is
##Fetch layer name=name ##Layer=vector ##Result=output vector layer = processing.getObject(Layer) processing.runalg("qgis:fieldcalculator", Layer, layer.name(), 2, 99, 0, True, "'" + layer.name() + "'", Result)
You can have a look at the documentation on how to create scripts and call various functions and their associated parameters: